# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年08月20日
"""
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
from docx import Document

file = Document('./练习/17结果03.docx')
hd = file.sections[1].header
ft = file.sections[1].footer

hd.is_linked_to_previous = False
# hd.paragraphs[0].add_run('这是第2个节的页眉')
hd.paragraphs[0].alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
ft.is_linked_to_previous = False
ft.paragraphs[0].add_run('这是第2个节的页脚')

ft.paragraphs[0].alignment = WD_PARAGRAPH_ALIGNMENT.CENTER

file.save('./练习/18结果02.docx')
